package singleton;
/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2019-07-24 12:49
 * @notify 饿汉式单例类
 * @version 1.0
 */

public class EagerSingleton {
    //自己创建自己
    private static final EagerSingleton instance = new EagerSingleton();
    //构造私有,外部不可创建实例
    private EagerSingleton(){}
    //静态工厂返回实例
    public static EagerSingleton getInstance(){
        return instance;
    }
}
